package com.usian.controller;

import com.usian.service.ContentService;
import com.usian.utils.AdNode;
import com.usian.utils.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author lpf
 * @Date 2022/3/24 下午3:26
 * @ProjectName java134-e-commerce-project
 * @Version 1.0
 * @Description:
 */
@RestController
@RequestMapping(value = "service/content")
public class ContentController {

    @Autowired
    private ContentService contentService;
    /**
     * 根据categoryID查询内容接口
     * @param rows
     * @param pages
     * @param categoryId
     * @return
     * @Auth lpf
     */
    @RequestMapping(value = "selectTbContentAllByCategoryId")
    public PageResult selectTbContentAllByCategoryId(@RequestParam Integer rows, @RequestParam Integer pages, @RequestParam Long categoryId){
        return contentService.selectTbContentAllByCategoryId(rows, pages, categoryId);
    }

    /**
     * 首页大广告位接口
     * @return
     * @Auth shangxingming
     */
    @RequestMapping("selectFrontendContentByAD")
    public List<AdNode> selectFrontendContentByAD(){
        return contentService.selectFrontendContentByAD();
    }
}
